package com.quectel.constant.core.invoice;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/4/7 13:05
 * @description new java file header...
 */
public class InvoiceConstants {


    /**
     * 开票状态
     * 1。待开票
     * 2。已开票
     * 3。发票冲红
     * 4。已关闭
     */
    public static final String INVOICE_STATUS = "InvoiceStatus";


    /**
     * 发票性质
     * 1.普通发票   2.增值税发票
     */
    public static final String INVOICE_NATURE = "InvoiceNature";


    /**
     * 发票抬头类型
     * 1.企业 2.个人
     */
    public static final String INVOICE_TITLE_TYPE = "InvoiceTitleType";


    /**
     * 发票类型
     */
    @AllArgsConstructor
    public enum InvoiceType {
        // 1电子发票
        ELECTRONIC((byte) 1),
        // 2纸质发票
        PAPER((byte) 2);

        @Getter
        private Byte type;
    }

    /**
     * 发票性质
     */
    @AllArgsConstructor
    public enum InvoiceNature {
        // 1普通发票
        PLAIN((byte) 1),
        // 2增值税专票
        VAT((byte) 2);

        @Getter
        private Byte type;
    }

    /**
     * 开票状态
     */
    @AllArgsConstructor
    public enum InvoiceStatus {
        // 初始化状态
        NOT_SUBMITTED("未提交开票", (byte) 0),
        // 待开票
        TO_BE_INVOICE("申请开票,开票中", (byte) 1),
        // 已开票
        WAS_INVOICE("已开票", (byte) 2),
        // 发票红冲
        RED_INVOICE("发票冲红", (byte) 3),
        // 已关闭
        CLOSED("已关闭", (byte) 4);
        @Getter
        private String description;
        @Getter
        private Byte type;
    }


    @AllArgsConstructor
    public enum SourceType {
        /**
         * 企业
         */
        ENTERPRISE((byte) 1, "企业"),
        /**
         * 个人
         */
        PERSONAL((byte) 2, "个人");

        @Getter
        private Byte sourceType;
        @Getter
        private String desc;
    }

    @AllArgsConstructor
    public enum PersonSourceTypeEnum {
        // 住户
        HOUSEHOLD((byte) 1),
        ;

        @Getter
        private final Byte personSourceType;
    }

    /**
     * 是否默认1是0否
     */
    @AllArgsConstructor
    public enum isDefaultStatus {

        /**
         * 非默认
         */
        NO((byte) 0, "非默认"),

        /**
         * 默认
         */
        YES((byte) 1, "默认");

        @Getter
        private Byte type;
        @Getter
        private String desc;
    }

    @AllArgsConstructor
    public enum InvoiceItemSourceType {
        /**
         * 物业账单
         */
        PROPERTY_BILL((byte) 1, "物业费账单"),
        /**
         * 临停账单
         */
        PARKING_BIll((byte) 2, "临停账单"),
        /**
         * 停车月卡账单
         */
        PARKING_CARD((byte) 3, "停车月卡账单"),

        ;

        @Getter
        private Byte type;
        @Getter
        private String desc;

        public static InvoiceItemSourceType find(Byte aByte) {
            for (InvoiceItemSourceType value : InvoiceItemSourceType.values()) {
                if (aByte.equals(value.getType())) {
                    return value;
                }
            }
            return null;
        }

    }

}
